package com.ruoyi.pets.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pets.mapper.PetHealthMapper;
import com.ruoyi.pets.domain.PetHealth;
import com.ruoyi.pets.service.IPetHealthService;

/**
 * 宠物健康Service业务层处理
 * 
 * @author isc
 * @date 2024-03-11
 */
@Service
public class PetHealthServiceImpl implements IPetHealthService 
{
    @Autowired
    private PetHealthMapper petHealthMapper;

    /**
     * 查询宠物健康
     * 
     * @param id 宠物健康主键
     * @return 宠物健康
     */
    @Override
    public PetHealth selectPetHealthById(Long id)
    {
        return petHealthMapper.selectPetHealthById(id);
    }

    /**
     * 查询宠物健康列表
     * 
     * @param petHealth 宠物健康
     * @return 宠物健康
     */
    @Override
    public List<PetHealth> selectPetHealthList(PetHealth petHealth)
    {
        return petHealthMapper.selectPetHealthList(petHealth);
    }

    /**
     * 新增宠物健康
     * 
     * @param petHealth 宠物健康
     * @return 结果
     */
    @Override
    public int insertPetHealth(PetHealth petHealth)
    {
        petHealth.setCreateTime(DateUtils.getNowDate());
        return petHealthMapper.insertPetHealth(petHealth);
    }

    /**
     * 修改宠物健康
     * 
     * @param petHealth 宠物健康
     * @return 结果
     */
    @Override
    public int updatePetHealth(PetHealth petHealth)
    {
        petHealth.setUpdateTime(DateUtils.getNowDate());
        return petHealthMapper.updatePetHealth(petHealth);
    }

    /**
     * 批量删除宠物健康
     * 
     * @param ids 需要删除的宠物健康主键
     * @return 结果
     */
    @Override
    public int deletePetHealthByIds(Long[] ids)
    {
        return petHealthMapper.deletePetHealthByIds(ids);
    }

    /**
     * 删除宠物健康信息
     * 
     * @param id 宠物健康主键
     * @return 结果
     */
    @Override
    public int deletePetHealthById(Long id)
    {
        return petHealthMapper.deletePetHealthById(id);
    }
}
